<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自定义对象</title>
</head>
<body>
    <div id="msg">

    </div>
</body>
<script>
    var person = {
        name : "zhangsan",
        age : 23,
        eat (){
            document.getElementById("msg").innerHTML = "<p>干饭</p>";
        }
    };
    person.eat();
</script>
</html>